package cn.boc.factory;

import cn.boc.pojo.Fruit;

/**
 * @description: 水果商店
 */
public class FruitStore {
    /**
     * 内部维护一个简单水果工厂
     */
    private SimpleFruitFactory factory;

    public FruitStore(SimpleFruitFactory factory) {
        this.factory = factory;
    }

    public Fruit orderFruit(String type) {

        Fruit fruit = SimpleFruitFactory.createFruit(type);

        fruit.show();

        return fruit;
    }
}
